package org.diviner.chat01.controller;

import org.diviner.chat01.model.Message;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @author ：xuchao
 * @date ：Created in 2021/3/26 13:20
 * @description：打招呼的控制层
 * @modified By：
 * @version:
 */
@Controller
public class GreetingController {

    @MessageMapping("/hello")
    @SendTo("/topic/greetings")
    public Message greeting(Message message){
        return message;
    }

}
